import * as ElementPlusIconsVue from '@element-plus/icons-vue';
import ElementPlus from 'element-plus';
import mitt from 'mitt';
import { createApp } from 'vue';

// import SvgIcon from '@/common/components/baseComponent/SvgIcon.vue';
import SvgIcon from '@/common/components/svg-icon/SvgIcon.vue';
import router from '@/router/index';
import pinia from '@/stores/index';

import App from './App.vue';

import 'cesium/Build/Cesium/Widgets/widgets.css';
import 'element-plus/dist/index.css';
import '@/styles/index.less';

import '@/assets/iconfont/iconfont.js';

window.CESIUM_BASE_URL = '/';
const vueEvent = mitt();

const app = createApp(App);
app.config.globalProperties.vueEvent = vueEvent;
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}
app.component('SvgIcon', SvgIcon);
app.use(pinia);
app.use(ElementPlus);
app.use(router);
app.mount('#app');
